package com.itheima.day15.work3;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class ServerDmeo {
    public static void main(String[] args) throws IOException {
        ServerSocket  ss=new ServerSocket(10004);
        //等待客户端连接
        Socket accept = ss.accept();
        BufferedReader  br=new BufferedReader(new InputStreamReader(accept.getInputStream()));
        String len;
        while ((len=br.readLine())!=null){
            System.out.println("服务器端："+len);
        }

        //给客户端反馈

        OutputStream outputStream = accept.getOutputStream();
        outputStream.write("数据已收到".getBytes());
      br.close();
      ss.close();
    }
    }

